{% extends "@CoreBundle/layout/main.html.twig" %}
{% import "@CmsBundleAdmin/macros/helpcategory_tree.html.twig" as macros %}

{% block page_title %}帮助分类管理
{% endblock %}
{% block head_stylesheets %}
	{{ parent() }}
	{{ encore_entry_link_tags('cms_admin_help_index_cate') }}
{% endblock %}
{% block body_javascript %}
	{{ parent() }}
	{{ encore_entry_script_tags('cms_admin_help_index_cate') }}
{% endblock %}
{% block body_custom_javascript %}
	<script>
		var admin_api_cms_help_category_updateSort_url = '{{ path('admin_api_cms_help_category_updateSort') }}';
	</script>
{% endblock %}

{% block page %}
	<div class="row">
		<div class="col-md-6">
			<div class="card card-default">
				<div class="card-header">
					<div class="btn-group">
						<button class="btn btn-primary btn-sm tree-tools" data-action="expand" title="展开">
							<i class="mdi mdi-plus-box-outline"></i>&nbsp;展开
						</button>
						<button class="btn btn-primary btn-sm tree-tools active" data-action="collapse" title="收起">
							<i class="mdi mdi-minus-box-outline"></i>&nbsp;收起
						</button>
					</div>
					{% if is_authorized('admin_api_cms_help_category_updateSort') %}
						<div class="btn-group">
							<button class="btn btn-info btn-sm" id="sortSave" title="保存">
								<i class="mdi mdi-content-save"></i>
								<span class="hidden-xs">&nbsp;保存排序
								</span>
							</button>
						</div>
					{% endif %}
				</div>
				<!-- /.box-header -->
				<div class="card-body table-responsive">
					<div class="dd" id="tree">
						{{ macros.helpcategory_tree(categorys) }}
					</div>
				</div>
				<!-- /.box-body -->
			</div>
		</div>
		{% if is_authorized('admin_api_cms_help_category_add') %}
			<div class="col-md-6">
				{{ addFormData|raw }}
			</div>
		{% endif %}
	</div>
{% endblock %}
